package com.hmall.search.web;

import com.hmall.search.service.impl.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    private SearchService searchService;

    /**
     * 根据条件查询商品
     */
    @PostMapping("/filters")
    public void filters(){

    }

    @PostMapping("/list")
    /**
     * es过滤后返回查询条件给前端
     */
    public Map<String, List<String>> list() throws IOException {
        return searchService.list();
    }
}
